package com.common.util;

import android.content.Context;
import android.text.TextUtils;

import com.common.sp.CommSp2;
import com.curry.android.util.PhoneCallUtil;
import com.curry.orangelife.mobile.R;

/**
 * 橙子生活拨打电话
 * <p/>
 * Created by wgf on 2016/7/18.
 *
 * @author wgf
 * @since v3.8
 */
public class OrangePhoneUtil {

    /** 拨打橙子生活客服电话 - 确认打电话给小橙客服吗 */
    public static void callCustomerService2(Context context) {
        PhoneCallUtil.getInstances().callPhone(context, CommSp2.getCustomerServicePhone(), context.getResources().getString(R.string.customer_phone));
    }

    /** 拨打当前小区的物业电话 */
    public static void callCommProperty(Context context) {
        callCommProperty(context, CommSp2.getCommPmPhone());
    }

    public static void callCommProperty(Context context, String phone) {
        callCommProperty(context, phone, CommSp2.getCommName());
    }

    public static void callCommProperty(Context context, String phone, String commName) {
        if (TextUtils.isEmpty(phone)) {
            phone = CommSp2.getCommPmPhone();
        }
        if (TextUtils.isEmpty(commName)) {
            commName = CommSp2.getCommName();
        }
        PhoneCallUtil.getInstances().callPhone(context, phone, "呼叫" + commName + "物业服务热线？");
    }
}
